import { createRouter, createWebHashHistory } from 'vue-router'
import routers from './router'

const routerConfig = {
  history: createWebHashHistory(),
  scrollBehavior(/* to, from, savedPosition */) {
    return { top: 0 }
  },
  routes: routers as any
}

const router = createRouter(routerConfig)

// export function resetRouter() {
//   const newRouter = createRouter(routerConfig)
//   router.matcher = newRouter.matcher // reset router
// }

export default router
